function ret=max_distance(mplist,mp)
 d=0;
 for i=1:length(mplist)
  p=mplist{i};
  td=distance(p.mat,mp.mat);
  if(td>d)
   d=td;
   ret={p,td,i};
  endif
 endfor
endfunction
